this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient);
this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
- this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
+ this._userVerifier.connect('reset', Lang.bind(this, this._reset));
this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
this._verifyingUser = false;
Lang.bind(this, this._updateBanner));
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_TEXT_KEY,
Lang.bind(this, this._updateBanner));
+ this._settings.connect('changed::' + GdmUtil.DISABLE_USER_LIST_KEY,
+ Lang.bind(this, this._updateDisableUserList));
this._bannerLabel = new St.Label({ style_class: 'login-dialog-banner',
text: '' });
this._updateBanner();
this._titleLabel = new St.Label({ style_class: 'login-dialog-title',
- text: C_("title", "Sign In") });
+ text: C_("title", "Sign In"),
+ visible: false });
this.contentLayout.add(this._titleLabel,
{ y_fill: false,
x_align: St.Align.START,
x_fill: true });
- this._notListedButton.connect('clicked', Lang.bind(this, this._onNotListedClicked));
+ this._notListedButton.connect('clicked', Lang.bind(this, this._hideUserListAndLogIn));
this.contentLayout.add(this._notListedButton,
{ expand: false,
},
+ _updateDisableUserList: function() {
+ let disableUserList = this._settings.get_boolean(GdmUtil.DISABLE_USER_LIST_KEY);
+
+ // If this is the first time around, set initial focus
+ if (this._disableUserList == undefined && disableUserList)
+ this.setInitialKeyFocus(this._promptEntry);
+
+ if (disableUserList != this._disableUserList) {
+ this._disableUserList = disableUserList;
+
+ if (!this._verifyingUser)
+ this._reset();
+ }
+ },
+
_updateBanner: function() {
let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY);
let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY);
}
},
- _onReset: function(client, serviceName) {
+ _reset: function() {
this._promptMessage.hide();
-
- let tasks = [this._hidePrompt,
-
- new Batch.ConcurrentBatch(this, [this._fadeInTitleLabel,
- this._fadeInNotListedButton]),
-
- function() {
- this._sessionList.close();
- this._promptLoginHint.hide();
- this._userList.actor.show();
- this._userList.actor.opacity = 255;
- return this._userList.showItems();
- },
-
- function() {
- this._userList.actor.reactive = true;
- this._userList.actor.grab_key_focus();
- }];
-
this._user = null;
this._verifyingUser = false;
- let batch = new Batch.ConsecutiveBatch(this, tasks);
- batch.run();
+ if (this._disableUserList)
+ this._hideUserListAndLogIn();
+ else
+ this._showUserList();
},
_onDefaultSessionChanged: function(client, sessionId) {
}),
label: C_("button", "Sign In"),
default: true };
+ let buttons = [];
+ if (!this._disableUserList || this._verifyingUser)
+ buttons.push(cancelButtonInfo);
+ buttons.push(okButtonInfo);
let tasks = [function() {
return this._fadeInPrompt();
},
function() {
- this.setButtons([cancelButtonInfo, okButtonInfo]);
+ this.setButtons(buttons);
let updateOkButtonEnabled = Lang.bind(this, function() {
let sensitive = this._promptEntry.text.length > 0;
}));
},
- _onNotListedClicked: function() {
+ _hideUserListAndLogIn: function() {
let tasks = [function() {
return this._userList.hideItems();
},
batch.run();
},
+ _showUserList: function() {
+ let tasks = [this._hidePrompt,
+
+ new Batch.ConcurrentBatch(this, [this._fadeInTitleLabel,
+ this._fadeInNotListedButton]),
+
+ function() {
+ this._sessionList.close();
+ this._promptLoginHint.hide();
+ this._userList.actor.show();
+ this._userList.actor.opacity = 255;
+ return this._userList.showItems();
+ },
+
+ function() {
+ this._userList.actor.reactive = true;
+ this._userList.actor.grab_key_focus();
+ }];
+
+ let batch = new Batch.ConsecutiveBatch(this, tasks);
+ batch.run();
+ },
+
_fadeInBanner: function() {
return GdmUtil.fadeInActor(this._bannerLabel);
},
this._userList.addUser(users[i]);
}
+ this._updateDisableUserList();
+
this._userManager.connect('user-added',
Lang.bind(this, function(userManager, user) {
this._userList.addUser(user);